package com.ys.test01;


public class First {
    public static void main(String[] args) {
        int i, j, k, n=5;
        for (i = 1; i <= n; i++) {
            //根据外层行号，输出星号左边空格
            for (j = 1; j <= n - i; j++) {
                System.out.print(" ");//根据外层行号，输出星号个数
            }
            for (k = 1; k <= 2 * i - 1; k++) {
                System.out.printf("*");//一行结束，换行
            }
            System.out.printf("\n");
        }
    }

}